import { defineStore } from 'pinia'

export const useLogin = defineStore('loginInfo', {
 
  state: () => {
    return {
      token: localStorage.getItem('token')||''
    }
  },
  actions:{
    updateToken(token:string){
        this.token = token
        localStorage.setItem('token', token)
    },
    removeToken(){
        this.token = ''
        localStorage.removeItem('token')
    }
  }
})
